import request from '@/utils/request.js';

// 简历相关接口
export const resumeApi = {
  // 查找简历
  checkProfile: () => request.get('/resume/check'),
  // 上传简历文件
  upload: (file) => {
    const formData = new FormData()
    formData.append('file', file)
    return request.post('/resume/upload', formData, {
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    })
  },
  // 上传职位描述
  submitJobDescription: (formData) => request.post('/resume/submit-form', formData)
}

// 职位相关接口
// export const jdApi = {
//   // 新增获取推荐职位接口
//   getRecommendedJobs: () => axios.get('/jd/recommendations'),
//   // 职位描述表单提交
//   submitJobDescription: (formData) => axios.post('/jd/submit-form', formData)
// }

// 诊断相关接口
export const diagnosisApi = {
  // 获取初始诊断结果
  getInitialDiagnosis: (params) => request.get('/diagnosis', { params }),
  // 根据用户输入重新诊断的结果
  regenerateDiagnosis: (data) => request.post('/diagnosis/regenerate', data),
  // 获取诊断报告
  downloadReport: (resumeId) => request.get(`/diagnosis/report/${resumeId}`, {
    responseType: 'blob'
  }),
  // 新增人工请求接口
  submitManualRequest: (data) => request.post('/api/manual-request', data)
}